package cn.changeforyou.base.exception;

import cn.changeforyou.base.model.Module;

public enum SystemExceptionEnum implements ErrorInfo {

    SYSTEM_ERROR(500, "系统异常"),
    NO_MODULE_INFO(501, "没有该模块信息"),
    NO_PLATFORM_INFO(502, "平台信息异常"),
    SYSTEM_COMPONENT_IS_NOT_PREPARED(503, "系统组件还没准备好"),

    ;

    SystemExceptionEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    private int code;
    private String message;

    @Override
    public int unitCode() {
        return getModelCode() + getCode();
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public Module getModule() {
        return Module.SYSTEM_MODULE;
    }
}
